import { request } from "@/utils/request"
import type * as Login from "./types/login"

/** 获取登录验证码 */
export function getLoginCodeApi() {
  return request<Login.LoginCodeResponseData>({
    url: "/v1.0/auth/getCode",
    method: "get"
  })
}

export function loginApi(data) {
  return request<Login.LoginResponseData>({
    url: "/v1.0/auth/login",
    method: "post",
    params: data
  })
}

/** 获取用户详情 */
export function getUserInfoApi(userId: string | number) {
  return request<Login.UserInfoResponseData>({
    url: `/v1.0/auth/getInfo?id=${userId}`,
    method: "get"
  })
}
